package com.qbw.app.model;

import java.util.List;

/**
 * @author QBW
 * @date 2019-08-24
 */
public class Problem extends BaseModel {

    private int deviceType;
    private String faultCode;
    private String faultCodeDec;
    private int faultLevel;
    private int faultType;
    private int id;
    /**
     * 历史故障发生时间
     */
    private long startTime;
    private long endTime;
    private String vehicleCode;
    /**
     * 实时故障发生时间
     */
    private long aultTime;

    public int getDeviceType() {
        return deviceType;
    }

    public void setDeviceType(int deviceType) {
        this.deviceType = deviceType;
    }

    public String getFaultCode() {
        return faultCode;
    }

    public void setFaultCode(String faultCode) {
        this.faultCode = faultCode;
    }

    public String getFaultCodeDec() {
        return faultCodeDec;
    }

    public void setFaultCodeDec(String faultCodeDec) {
        this.faultCodeDec = faultCodeDec;
    }

    public int getFaultLevel() {
        return faultLevel;
    }

    public void setFaultLevel(int faultLevel) {
        this.faultLevel = faultLevel;
    }

    public int getFaultType() {
        return faultType;
    }

    public void setFaultType(int faultType) {
        this.faultType = faultType;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public long getStartTime() {
        return startTime;
    }

    public void setStartTime(long startTime) {
        this.startTime = startTime;
    }

    public long getEndTime() {
        return endTime;
    }

    public void setEndTime(long endTime) {
        this.endTime = endTime;
    }

    public String getVehicleCode() {
        return vehicleCode;
    }

    public void setVehicleCode(String vehicleCode) {
        this.vehicleCode = vehicleCode;
    }

    public long getAultTime() {
        return aultTime;
    }

    public void setAultTime(long aultTime) {
        this.aultTime = aultTime;
    }

    public static class HistoryFaultList extends BaseModel {

        private List<Problem> rows;

        public List<Problem> getRows() {
            return rows;
        }

        public void setRows(List<Problem> rows) {
            this.rows = rows;
        }
    }

    public static class Data extends BaseModel {
        private HistoryFaultList historyFaultList;
        private List<Problem> realFaultList;
        private long lastUpdateTime;

        public HistoryFaultList getHistoryFaultList() {
            return historyFaultList;
        }

        public List<Problem> getRealFaultList() {
            return realFaultList;
        }

        public long getLastUpdateTime() {
            return lastUpdateTime;
        }

        public int realFaultListSize() {
            return realFaultList == null ? 0 : realFaultList.size();
        }

        public int historyFaultListSize() {
            return historyFaultList == null || historyFaultList.rows == null ? 0 : historyFaultList.rows.size();
        }

        public List<Problem> getHistoryFaultRowList() {
            return historyFaultList == null ? null : historyFaultList.rows;
        }
    }

    public static class Response extends BaseResponse<Data> {}
}
